﻿using System;
using System.Xml;
using System.Configuration;
using System.Text;

namespace xCodeCounter
{
	static class Config
	{
		static string profilename = null;
		public static string GetProfileName()
		{
			if (profilename == null)
			{
				string dir = AppDomain.CurrentDomain.BaseDirectory;
				string app = AppDomain.CurrentDomain.FriendlyName.Replace(".vshost.", "");
				profilename = dir + "" + app + ".ini";
			}
			return profilename;
		}


		public static string GetString(string key)
		{
			StringBuilder sb = new StringBuilder();
			Win32.GetPrivateProfileString("System", key, "", sb, 10000, GetProfileName());
			string ret = sb.ToString();
			return ret;
		}

		public static void WriteString(string key, string val)
		{
			Win32.WritePrivateProfileString("System", key, val, GetProfileName());
		}

	}
}
